home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 8353 < prev    next >
Encoding:
Text File  |  1996-08-05  |  24.2 KB  |  836 lines

  1. Path: news.onramp.net!usenet
  2. From: magras@suite.com (JC Magras)
  3. Newsgroups: gnu.g++.help,comp.lang.c++
  4. Subject: Is there a libg++-2.7.2
  5. Date: 17 Feb 1996 01:46:58 GMT
  6. Organization: On-Ramp; Individual Internet Connections; Dallas/Ft Worth/Houston, TX USA
  7. Message-ID: <4g3c2j$3ug@news.onramp.net>
  8. NNTP-Posting-Host: s175-18.suite.com
  9.  
  10. Greeting Gnu hackers,
  11.  
  12. The g++ INSTALL file says you should install a libg++ library with the same
  13. version number as the compiler, but I cant find libg++-2.7.2 at even
  14. prep.mit.edu. 
  15.  
  16. This is the only problem I can think of that is causing the undefined label
  17. errors for two virtual tables of classes I have defined in the appended 
  18. shar'ed file. GameContainer.hxx declares the two clases, one derived from the
  19. other.
  20.  
  21.  
  22.  
  23. **************************
  24. g++ -g -Wall -I/usr/local/lib/g++-include -c  GameObject.cxx GameControl.cxx 
  25. GameContainer.cxx  room.cxx 
  26. GameContainer.hxx: In method `class GameContainer & GameContainer::operator 
  27. =(const class GameContainer &)':
  28. In file included from GameContainer.cxx:4:
  29. GameContainer.hxx:8: warning: unused parameter `const class GameContainer & 
  30. one_container'
  31. GameContainer.hxx: In method `class GameBottle & GameBottle::operator =(const 
  32. class GameBottle &)':
  33. GameContainer.hxx:35: warning: unused parameter `const class GameBottle & 
  34. one_bottle'
  35. GameContainer.hxx: In method `class GameContainer & GameContainer::operator 
  36. =(const class GameContainer &)':
  37. In file included from room.cxx:5:
  38. GameContainer.hxx:8: warning: unused parameter `const class GameContainer & 
  39. one_container'
  40. GameContainer.hxx: In method `class GameBottle & GameBottle::operator =(const 
  41. class GameBottle &)':
  42. GameContainer.hxx:35: warning: unused parameter `const class GameBottle & 
  43. one_bottle'
  44. room.cxx: In function `int main()':
  45. room.cxx:126: warning: initialization to 
  46. `basic_string<char,string_char_traits<char> > *' from `const 
  47. basic_string<char,string_char_traits<char> > *' discards const
  48. room.cxx:126: warning: initialization to 
  49. `basic_string<char,string_char_traits<char> > *' from `const 
  50. basic_string<char,string_char_traits<char> > *' discards const
  51. g++ -g -Wall -I/usr/local/lib/g++-include  GameObject.o GameControl.o 
  52. GameContainer.o room.o -oroom 
  53. Undefined                       first referenced
  54.  symbol                             in file
  55. _vt.13GameContainer                 GameContainer.o
  56. _._10GameBottle                     room.o
  57. _vt.10GameBottle                    GameContainer.o
  58. ld: fatal: Symbol referencing errors. No output written to room
  59.  
  60.  
  61. #! /bin/sh
  62. # This is a shell archive, meaning:
  63. # 1. Remove everything above the #! /bin/sh line.
  64. # 2. Save the resulting text in a file.
  65. # 3. Execute the file with /bin/sh (not csh) to create the files:
  66. #    Makefile
  67. #    GameContainer.cxx
  68. #    GameContainer.hxx
  69. #    GameControl.cxx
  70. #    GameControl.hxx
  71. #    GameObject.cxx
  72. #    GameObject.hxx
  73. #    room.cxx
  74. # This archive created: Fri Feb 16 19:37:22 1996
  75. export PATH; PATH=/bin:$PATH
  76. if test -f 'Makefile'
  77. then
  78.     echo shar: will not over-write existing file "'Makefile'"
  79. else
  80. cat << \SHAR_EOF > 'Makefile'
  81. CC=g++
  82. GPPINCLUDE=/usr/local/lib/g++-include
  83. CFLAGS=-g -Wall -I${GPPINCLUDE}
  84.  
  85. default:: objects GameObject.cxx GameControl.cxx GameContainer.cxx
  86.     ${CC} ${CFLAGS}  GameObject.o GameControl.o GameContainer.o room.o 
  87. -oroom 
  88. SRCS=GameObject.cxx GameControl.cxx GameContainer.cxx 
  89. HEADERS=${SRCS:.cxx=.hxx}
  90. objects:: room.cxx ${SRCS} ${HEADERS}
  91.     ${CC} ${CFLAGS} -c  ${SRCS} room.cxx 
  92.  
  93. clean:
  94.     -rm room
  95.  
  96. uninstall: 
  97.     -rm /usr/local/bin/rooms
  98. SHAR_EOF
  99. fi # end of overwriting check
  100. if test -f 'GameContainer.cxx'
  101. then
  102.     echo shar: will not over-write existing file "'GameContainer.cxx'"
  103. else
  104. cat << \SHAR_EOF > 'GameContainer.cxx'
  105. #define estring string
  106. #include <string>
  107. #include <iostream.h>
  108. #include "GameContainer.hxx"
  109.  
  110.  
  111. //Default Constructor for no Paramaters
  112. GameContainer::GameContainer(void) { item_count=0;contents[0]=0; }
  113.  
  114.  
  115. // Destructor
  116. GameContainer::~GameContainer()
  117.   {
  118.      int index;
  119.      for (index=0;index < this->item_count;index++) {
  120.          delete contents[index];
  121.      }
  122. }
  123.  
  124.  
  125. // Constructor GameObject  from another GameObject
  126. GameContainer::GameContainer (const GameObject &old_game_object) {
  127.     contents[0]=new GameObject(old_game_object);
  128.     this->GameObjectName=new string("bucket");
  129. }
  130.  
  131. // Constructor GameObject from a name and a unsigned array of attributes
  132. GameContainer::GameContainer(const string &ObjectName ,
  133.     unsigned long int ObjectFlags[]) {
  134.     contents[0]=new GameObject(ObjectName,ObjectFlags);
  135.     item_count=1;
  136. }
  137.  
  138. ostream &operator << (
  139.     ostream &out_file ,
  140.     const GameContainer &thisBox
  141. {
  142.     int index;
  143.     for (index=0;index < thisBox.item_count;index++) {
  144.         out_file << string("a " )
  145.                  << (const estring &) 
  146. *((thisBox.contents[0])->GameObjectName)
  147.                  <<   string("\n");
  148.                  // (const estring &)game_piece.get_contents(game_piece) << 
  149. "\n";
  150.     }
  151.     return (out_file);
  152. }
  153. /*
  154. const string & get_contents(const GameContainer &jug)
  155.  { return ((const string &) (jug.contents[0]->GameObjectName)); }
  156. */
  157.  
  158.  
  159. ostream &operator << (
  160.     ostream &out_file,
  161.     const GameBottle &thisBottle
  162. {
  163.     string c_which_con(" which contains ") ;
  164.     string c_of(" of ");
  165.    //if (game_piece.contents == 0) { return (out_file) };
  166.    out_file  << *(thisBottle.GameObjectName)
  167.    <<  c_which_con;
  168.    if (thisBottle.current_load!=LONG_MAX)
  169.        out_file << (unsigned) (thisBottle.current_load);
  170.    else 
  171.         out_file << 1000;
  172.    out_file << " " 
  173.    << (string ) (thisBottle.units)
  174.    <<    c_of
  175.      << (string ) *((thisBottle.contents[0])->GameObjectName) << "\n";
  176.  
  177.    return (out_file);
  178. }
  179. /*
  180. const estring &GameBottle::get_contents(const GameBottle &jug)
  181. { return ((const estring &) (jug.contents[0]->GameObjectName)); }
  182. */
  183. GameBottle::GameBottle():GameContainer() {max_capacity = 2000; 
  184. current_load=0; item_count=0; }   
  185.  
  186. GameBottle::GameBottle( const GameObject &what,
  187.                         signed long initial_load,
  188.                         unsigned long max_cap=1000 ):GameContainer(what)
  189. {
  190.  
  191.    contents[0]=new GameObject(what);
  192.    this->max_capacity = max_cap;
  193.    if (initial_load == QUA_INF) {
  194.        this->max_capacity=LONG_MAX;
  195.        this->current_load=LONG_MAX;
  196.    }
  197.    else
  198.        this->current_load=initial_load;
  199. }
  200.  
  201. GameBottle::GameBottle(
  202.     const estring what,
  203.     unsigned long int flags[],
  204.     signed long initial_load,
  205.     unsigned long max_cap=1000
  206. ):GameContainer(what,flags)
  207. {
  208.    
  209.    contents[0]=new GameObject(what,flags);
  210.    this->max_capacity = max_cap;
  211.    if (initial_load == QUA_INF) {
  212.        this->max_capacity=LONG_MAX;
  213.        this->current_load=LONG_MAX;
  214.    }
  215.    else
  216.        this->current_load=initial_load;
  217. }
  218.  
  219. GameBottle &operator += (
  220.     GameBottle  &game_piece,
  221.     const GameBottle  &resupply
  222. )
  223. {
  224.     //if (game_piece.what == resuppply.what)  ;
  225.     if (resupply.max_capacity==LONG_MAX) {
  226.        game_piece.current_load=1000;
  227.     }
  228.     else if((game_piece.current_load + resupply.current_load) > 
  229. game_piece.max_capacity) {
  230.        game_piece.current_load=1000;     
  231.     } else {
  232.           game_piece.current_load += resupply.current_load;
  233.     }
  234.     return game_piece;
  235. }
  236.  
  237. GameBottle &operator -= (
  238.       GameBottle  &game_piece ,
  239.       const GameBottle &withdrawl
  240. )
  241. {
  242.     //if (game_piece.what == withdrawl.what)  ;
  243.     if (withdrawl.max_capacity==LONG_MAX) {
  244.        game_piece.current_load=game_piece.max_capacity;
  245.     } else if (
  246.          ( withdrawl.current_load - 
  247.             (game_piece.max_capacity-game_piece.current_load)) < 0 ) {
  248.                      game_piece.current_load -= withdrawl.current_load;
  249.     } else
  250.                      game_piece.current_load=0;
  251.     return game_piece;
  252. }
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266. SHAR_EOF
  267. fi # end of overwriting check
  268. if test -f 'GameContainer.hxx'
  269. then
  270.     echo shar: will not over-write existing file "'GameContainer.hxx'"
  271. else
  272. cat << \SHAR_EOF > 'GameContainer.hxx'
  273. #ifndef _GAME_CONTAINER_H
  274. #define _GAME_CONTAINER_H
  275. #define QUA_INF -1
  276. #define estring string
  277. #include <limits.h>
  278. #include "GameObject.hxx"
  279. class GameContainer:public GameObject {
  280.     GameContainer &operator = (const GameContainer &one_container) {
  281.         return (*this);
  282.     };
  283.  
  284.     protected:
  285.     unsigned short item_count;
  286.     //GameControl *dials;
  287.     public:
  288.     GameObject **contents;
  289.     //const string &get_contents(const GameContainer &jug) const;
  290.     virtual unsigned short get_percentage_full(void);
  291.     GameContainer(void) ;
  292.     GameContainer(const estring ObjectName);
  293.     GameContainer (const GameObject &old_game_object) ;
  294.     GameContainer(const string &ObjectName , unsigned long int 
  295. ObjectFlags[]);
  296.  
  297.     virtual ~GameContainer(void);
  298.  
  299.    friend ostream &operator << ( ostream &out_file,
  300.                                   const GameContainer  &game_piece);
  301.  
  302.  
  303. };
  304.  
  305.  
  306.  
  307. class GameBottle:public GameContainer {
  308.     GameBottle &operator = (const GameBottle &one_bottle) { return (*this); 
  309. };
  310.     protected:
  311.     // GameObject **contents;
  312.     signed long int max_capacity;
  313.     signed long int current_load;
  314.     const estring units("milliliters");
  315.  
  316.     //GameControl *dials;
  317.     public:
  318.     //GameObject **contents;
  319.     //const string &get_contents(const GameBottle &jug) ;
  320.     unsigned short get_percentage_full(void);
  321.     GameBottle(); // { max_capacity = 2000; current_load=0; item_count=0;};
  322.     GameBottle( const estring what,
  323.                 unsigned long int flags[],
  324.                 signed long inital_load,
  325.                 unsigned long max_cap=1000);
  326.     GameBottle( const GameObject &what,
  327.                 signed long inital_load,
  328.                 unsigned long max_cap=1000 );
  329.     virtual ~GameBottle() { if (contents[0]) {
  330.                        delete contents[0];
  331.                     }
  332.                     item_count=0;
  333.                   };
  334.     friend GameBottle &operator += (GameBottle  &game_piece,
  335.                                        const GameBottle  &resupply);
  336.     friend GameBottle &operator -= (GameBottle  &game_piece,
  337.                                        const GameBottle  &withdrawl);
  338.     friend ostream &operator << (ostream &out_file,
  339.                                 const GameBottle  &game_piece);
  340.  
  341. };
  342.  
  343. #endif
  344. SHAR_EOF
  345. fi # end of overwriting check
  346. if test -f 'GameControl.cxx'
  347. then
  348.     echo shar: will not over-write existing file "'GameControl.cxx'"
  349. else
  350. cat << \SHAR_EOF > 'GameControl.cxx'
  351. #define estring string
  352. #include <string>
  353. #include  "GameControl.hxx"
  354.  
  355. /*ostream &GameControl::operator << ( ostream &out_file)
  356. {
  357.  
  358.     out_file << *(this->settings[this->current_state]);
  359.    return (out_file);
  360.  
  361. }
  362. */
  363.  
  364. GameControl::GameControl(
  365.      const string name,
  366.      estring *settings[],
  367.      unsigned long int attributes[],
  368.      const estring *machine,
  369.      unsigned int start=es_Start
  370.  ) :GameObject(name,attributes+sizeof(unsigned long))
  371.  {
  372.     GameControl::settings=settings;
  373.     GameControl::FSA=machine;
  374.     GameControl::controlname=new estring(name.data());
  375.     GameControl::current_state=start;
  376.     GameControl::number_of_states=attributes[0];
  377. }
  378.  
  379. ostream &operator << ( ostream &out_file, const SlotDevice &thisSlot)
  380. {
  381.  
  382.     out_file << *(thisSlot.settings[thisSlot.current_state]);
  383.    return (out_file);
  384.  
  385. }
  386.  
  387. SHAR_EOF
  388. fi # end of overwriting check
  389. if test -f 'GameControl.hxx'
  390. then
  391.     echo shar: will not over-write existing file "'GameControl.hxx'"
  392. else
  393. cat << \SHAR_EOF > 'GameControl.hxx'
  394. #ifndef _GAME_CONTROL_H
  395. #define _GAME_CONTROL_H
  396. #define estring string
  397. #include <iostream.h>
  398. #include "GameObject.hxx"
  399.  
  400.  
  401. class GameControl : public GameObject {
  402.     protected:
  403.     unsigned long int current_state;
  404.     private:
  405.     unsigned int number_of_states;
  406.     const estring *controlname;
  407.     const estring *FSA;
  408.     public:
  409.     estring **settings;
  410.     enum {es_Start=0,es_Middle=1,es_Final=100,e_state_count=3};
  411.     enum { 
  412.           e_pushable=1,
  413.           e_receptacle=2,
  414.           e_post_turnable=4,
  415.           e_turnable=8,
  416.           e_pullable=16,
  417.           e_squeeze=32
  418.          };
  419.     enum {
  420.         e_evt_insert=1,
  421.         e_evt_turn=2,
  422.         e_evt_push=4,
  423.         e_evt_pull=8,
  424.         e_evt_squeeze=16
  425.     };
  426.     enum {
  427.         e_resp_nothing=1,
  428.         e_resp_death=2,
  429.         e_resp_new_state=4,
  430.         e_resp_transport=8,
  431.         e_resp_suspend=16
  432.     }; 
  433.     bool IsInFinalState() { return (GameControl::current_state == 
  434. GameControl::es_Final);};
  435.     int process_input( unsigned event_code,
  436.                      estring destination,
  437.                      estring *aux_data);
  438.     virtual ~GameControl() { cout << "Game Control Destructor called\n"; };
  439.     GameObject ();
  440.     GameControl (const GameControl &instance);
  441.     GameControl(const string name,
  442.                 estring *settings[],
  443.                 unsigned long int attributes[],
  444.                 const estring *machine,
  445.                 unsigned int start=es_Start);
  446.     friend ostream &operator << ( ostream &out_file,
  447.                            const GameControl &control );
  448.  
  449.     
  450. };
  451.  
  452. class SlotDevice : public GameControl {
  453.     protected:
  454.     //unsigned long int current_state;
  455.     public:
  456.     // enum {es_Start=0,es_Middle=1,es_Final=100,e_state_count=3};
  457.      enum { 
  458.           e_receptacle=2,
  459.          };
  460.     enum {
  461.         e_evt_insert=1,
  462.     };
  463.     enum {
  464.         e_resp_nothing=1,
  465.         e_resp_death=2,
  466.         e_resp_new_state=4,
  467.         e_resp_transport=8,
  468.         e_resp_suspend=16
  469.     }; 
  470.     bool IsInFinalState() { return (SlotDevice::current_state == 
  471. SlotDevice::es_Final);};
  472.     //int process_input( unsigned event_code,
  473.     //                 estring destination,
  474.     //                 estring *aux_data);
  475.     
  476.     virtual ~SlotDevice() { cout << "Slot Device Destructor called\n"; };
  477.     SlotDevice ();
  478.     SlotDevice (const SlotDevice &instance);
  479.     SlotDevice (
  480.            const estring name,
  481.            estring *settings[],
  482.            unsigned long int attributes[],
  483.            const estring *machine,
  484.            unsigned int start=es_Start):GameControl(name,
  485.                                                     settings,
  486.                                                     attributes,
  487.                                                     machine,
  488.                                                     start) { };
  489.  
  490.       friend ostream &operator << ( ostream &out_file ,
  491.                                      const SlotDevice &control );
  492. };
  493. #endif
  494. SHAR_EOF
  495. fi # end of overwriting check
  496. if test -f 'GameObject.cxx'
  497. then
  498.     echo shar: will not over-write existing file "'GameObject.cxx'"
  499. else
  500. cat << \SHAR_EOF > 'GameObject.cxx'
  501. #define estring string
  502. #include <string>
  503. #include "GameObject.hxx"
  504.  
  505.  
  506. ostream &operator << ( ostream &out_file, const GameObject  &game_piece );
  507. ostream &operator << (
  508.     ostream &out_file ,
  509.     const GameObject  &game_piece
  510. {
  511.    const string a_("a ");
  512.  
  513.    out_file << a_ << *(game_piece.GameObjectName);
  514.    return (out_file);
  515. }
  516.  
  517.  
  518. /*
  519. GameObject & GameObject::operator = (const GameObject &old_game_object) {
  520.    GameObject new_object(old_game_object);
  521.    return (new_object);
  522. }*/
  523.  
  524. GameObject::GameObject (const GameObject &old_game_object) {
  525.   GameObjectAttributes[0]=old_game_object.GameObjectAttributes[0];
  526.    this->GameObjectName = old_game_object.GameObjectName;
  527. }
  528.  
  529. GameObject::GameObject (
  530.   const estring ObjectName,
  531.   unsigned long int ObjectFlags[]
  532.  )
  533.  {
  534.    this->GameObjectName=new estring(ObjectName.data());
  535.    GameObjectAttributes[0]=ObjectFlags[0];
  536. }
  537.  
  538. GameObject::GameObject ( ) {
  539.    GameObjectName=new estring("");
  540.    GameObjectAttributes[0]=0;
  541. }
  542.  
  543.  
  544. SHAR_EOF
  545. fi # end of overwriting check
  546. if test -f 'GameObject.hxx'
  547. then
  548.     echo shar: will not over-write existing file "'GameObject.hxx'"
  549. else
  550. cat << \SHAR_EOF > 'GameObject.hxx'
  551. #ifndef _GAME_OBJECT_H
  552. #define _GAME_OBJECT_H
  553. #define estring string
  554. #include <string>
  555.  
  556. class GameObject {
  557.     protected:
  558.        enum {
  559.               NumberOfAttributes=10,
  560.               SizeOfGameObjectName=16*sizeof(unsigned long)
  561.        };
  562.  
  563.        unsigned long int  \
  564.           GameObjectAttributes[NumberOfAttributes/sizeof(unsigned long)];
  565.    public:
  566.        const estring *GameObjectName;
  567.        enum { GaObjStOpen=1,
  568.               GaObjAttrOpenable=2,
  569.               GaObjAttrWeapon=4,
  570.               GaObjAttrHandHeld=8,
  571.               GaObjAttrCrewofOne=16,
  572.               GaObjAttrNoLoad=32,
  573.               GaObjAttrWearable=64,
  574.               GaObjAttrRope=128,
  575.               GaObjAttrArmor=256,
  576.               GaObjAttrPaper=512,
  577.               GaObjAttrHasArea=1024,
  578.               GaObjAttrGlass=2048,
  579.               GaObjAttrBronze=4096,
  580.               GaObjAttrLiquidHold=8192,
  581.               GaObjAttrFood=16384,
  582.               GaObjAttrStone=32768,
  583.               GaObjAttrImmoveable=65536,
  584.               GaObjAttrDispenser=65536*2,
  585.               GaObjAttrAccessTool=65536*4
  586.          };
  587.        const string  Documentation( \
  588.        "This is the GameObject.It defines 
  589. GaObjStOpen,GaObjAttrOpenable,GaObjAttrWeapon,GaObjAttrHandHeld,GaObjAttrCrew
  590. ofOne,GaObjAttrNoLoad,GaObjAttrWearable,GaObjAttrRope,GaObjAttrArmor,GaObjAtt
  591. rPaper,GaObjAttrHasArea,GaObjAttrGlass,GaObjAttrBronze,GaObjAttrLiquidHold,Ga
  592. ObjAttrFood as enums. Function GaObjectIsOpen is a public member function.");
  593.        GameObject &operator = (const GameObject &old_game_object) const;
  594.  
  595.        GameObject (const GameObject& old_game_object) ;
  596.        GameObject (estring ObjectName,
  597.                    unsigned long int *ObjectFlags ) ;
  598.        GameObject ( ) ;
  599.  
  600.        virtual ~GameObject () { }        ;
  601.  
  602.        int GaObjectIsOpen(void) {
  603.                return ( GameObjectAttributes[0] & GaObjStOpen ); 
  604.        };
  605.        friend ostream &operator << ( ostream &out_file,
  606.                                  const GameObject  &game_piece );
  607.        // GameObject &operator [] ( const unsigned int index );
  608.        
  609. };
  610.  
  611. ostream &operator << ( ostream &out_file,const GameObject  &game_piece );
  612. #endif
  613. SHAR_EOF
  614. fi # end of overwriting check
  615. if test -f 'room.cxx'
  616. then
  617.     echo shar: will not over-write existing file "'room.cxx'"
  618. else
  619. cat << \SHAR_EOF > 'room.cxx'
  620. #include <iostream.h>
  621. #include <string>
  622. #include <limits.h>
  623. #include "GameControl.hxx"
  624. #include "GameContainer.hxx"
  625.  
  626. //#include "estring.hxx"
  627. #define estring string
  628.  
  629. #define QUA_INF -1
  630.  
  631.     GameBottle::GameBottle( const estring what,
  632.                 unsigned long int flags[],
  633.                 signed long inital_load,
  634.                 unsigned long max_cap=1000);
  635.     GameBottle::GameBottle( const GameObject &what,
  636.                 signed long inital_load,
  637.                 unsigned long max_cap=1000 );
  638.  
  639. class GameLocation {
  640.     GameContainer **LocContents;
  641.     GameObject **LocObjects;
  642.     const estring *locname;
  643.     const estring *loc_description;
  644.     
  645.     unsigned int local_flags[8];
  646.     GameLocation::SetAbsCoordinates();
  647.     GameLocation::SetExits();
  648.     public:
  649.     draw_outside();
  650.     draw_inside();
  651.     estring &GameLocation::GetAbsCoordinates();
  652.     estring &GameLocation::GetExits();
  653.     GameLocation(const GameLocation &room);
  654.     GameLocation(const estring *texts[],
  655.                  GameContainer **things,
  656.                  GameObject **contents);
  657.     can_access_objects();
  658.     bool GameLocation::can_enter();
  659.     bool GameLocation::can_exit();
  660.     bool GameLocation::magic();
  661.     friend ostream &operator << (ostream &out_file, const GameLocation 
  662. &there);
  663. };
  664.  
  665.  
  666. GameLocation::GameLocation (
  667.    const estring *texts[],
  668.    GameContainer **things,
  669.    GameObject **content
  670.  ) {
  671.     GameLocation::LocContents=things;
  672.     GameLocation::LocObjects=content;
  673.     this->locname=texts[0];
  674.     this->loc_description=texts[1];
  675. }
  676.  
  677.  
  678.  ostream& operator << (ostream &out_file,const GameLocation &there ){
  679.   out_file << *(there.locname) << "\n";
  680.   out_file << *(there.loc_description);
  681.   if (there.LocObjects != 0) {
  682.      out_file <<  " There is " << *((there.LocObjects[0])->GameObjectName) << 
  683. " here.";
  684.   }
  685.   if (there.LocContents != 0) {
  686.      out_file << " There is " << *((there.LocContents[0])->GameObjectName) << 
  687. " here.";
  688.   } 
  689.   out_file << "\n";
  690.   return (out_file);
  691. }
  692.  
  693. main () {
  694.    unsigned int index;
  695.    unsigned long int Gameattr[1]={
  696.       GameObject::GaObjAttrOpenable | GameObject::GaObjAttrWearable
  697.    };
  698.    unsigned long int swordattr[1]={
  699.       GameObject::GaObjAttrNoLoad | GameObject::GaObjAttrWeapon |
  700.       GameObject::GaObjAttrHandHeld | GameObject::GaObjAttrCrewofOne | 
  701.       GameObject::GaObjAttrBronze
  702.    };
  703.    unsigned long BreastPlateAttr[1] = {
  704.       GameObject::GaObjAttrWearable | GameObject::GaObjAttrArmor
  705.    };
  706.    unsigned long MapAttr[1]={
  707.       GameObject::GaObjAttrPaper | GameObject::GaObjAttrHasArea
  708.    };
  709.    unsigned long RopeAttr[1]= { GameObject::GaObjAttrRope };
  710.    unsigned long decanterAttr[1]={
  711.        GameObject::GaObjAttrGlass | GameObject::GaObjAttrOpenable |
  712.        GameObject::GaObjAttrLiquidHold
  713.    };
  714.    unsigned long fountainAttr[1]={
  715.        GameObject::GaObjAttrStone | GameObject::GaObjAttrImmoveable |
  716.        GameObject::GaObjAttrDispenser
  717.    };
  718.    unsigned long playerAttr[1]={0};
  719.    unsigned long keyAttr[1]={
  720.        GameObject::GaObjAttrBronze|GameObject::GaObjAttrAccessTool
  721.    };
  722.    unsigned long HeliCardSlotAttr[2]={
  723.        GameControl::e_receptacle,GameObject::GaObjAttrAccessTool
  724.    };
  725.    unsigned HeliStartState=GameControl::es_Start;
  726.  
  727.    const estring n_ring("ring");
  728.    const estring n_sword("sword");
  729.    const estring n_rope("rope");
  730.    const estring n_BreastPlate("BreastPlate");
  731.    const estring n_map("Treasure Map");
  732.    const estring n_vessel("vessel");
  733.    const estring n_water("water");
  734.    const estring n_player("Participant");
  735.    const estring n_key("Brass Key");
  736.    const estring n_pad("Landing Pad");
  737.    const estring d_pad("This is obviously a Helicopter pad as there is a 
  738. helicopter sitting here. The helicopter has a door built into it on each 
  739. side. There is an exit down a set of stairs.");
  740.  
  741.    const estring d_inside_helicopter("You are inside the helocopter,sitting 
  742. in on of two seats. In front of and between your knees, there is a long 
  743. joystick. There is also a large set of gauges on a control panel in front of 
  744. you. There is a twistable lever arm between the two seats.");
  745.  
  746.    const estring d_island_hpad("This is another helipad but it is on an 
  747. island. There is a large rectangular building at the end of a brick walkway, 
  748. down and to the northwest. In the roof of the building, you can see what seem 
  749. to be doors taking up most of the space of the roof. There is a sign saying 
  750. `Hanger 17` over the door way at the end of the walkway.");
  751.    const estring n_island_hpad("Island helipad");
  752.    const estring d_full_fuel("The fuel gauges seem to say full.");
  753.    const estring *room_texts[2]={&n_pad,&d_pad};
  754.  
  755.    const estring stand_by("There is an empty card slot in the panel. The 
  756. light above is off."),
  757.       ready("There is a card in the slot on the panel and above, a light is 
  758. lit.");
  759.    estring *settings[2]={&stand_by,&ready};
  760.    const estring Heli_slot("Incert Helikopter Akces Kard");
  761.    const estring m_Helislot("");
  762.    const estring n_inside_Heli("Inside Helicopter");
  763.     
  764.    GameObject vessel(n_vessel,decanterAttr);
  765.    GameObject fountain(n_vessel,fountainAttr);
  766.  
  767.    GameObject ring(n_ring,Gameattr);
  768.    GameObject sword(n_sword,swordattr);
  769.    GameObject rope(n_rope,RopeAttr);
  770.    GameObject BreastPlate(n_BreastPlate,BreastPlateAttr);
  771.    GameObject map(n_map,MapAttr);
  772.  
  773.    GameObject key(n_key,keyAttr);
  774.  
  775.    GameObject *inventory[]={&ring,&sword,&rope,&BreastPlate,&map};
  776.    GameObject stomach(n_player,playerAttr);
  777.    GameBottle decanter(vessel,67,1500) ;
  778.    GameBottle player1(stomach,10,1750) ; 
  779.    GameBottle water_fountain(fountain,QUA_INF,2400) ; 
  780.  
  781.    GameObject *things={&key};
  782.    GameContainer *pans={&water_fountain};
  783.    GameLocation room(room_texts,&pans,&things);
  784.  
  785.    const estring *Helicopter_texts[2]={&n_inside_Heli,&d_inside_helicopter};
  786.    GameLocation helicopter(Helicopter_texts ,(GameContainer**)NULL 
  787. ,(GameObject**)NULL);
  788.  
  789.    GameObject test(Heli_slot, &HeliCardSlotAttr[1]);
  790.  
  791.    SlotDevice HeliPanel( Heli_slot,
  792.                           settings,
  793.                           HeliCardSlotAttr,
  794.                           &m_Helislot,
  795.                            HeliStartState);
  796.  
  797.    for (index=0;index < sizeof(inventory)/sizeof(GameObject*);index++) {
  798.        cout << (*inventory[index]) << "\n" ;
  799.    }
  800.    cout << '\n';
  801.    cout << decanter;
  802.    cout << '\n';
  803.    cout << player1;
  804.    cout << '\n';
  805.    decanter +=water_fountain;
  806.  
  807.    for (index=0;index < sizeof(inventory)/sizeof(GameObject*);index++) {
  808.       cout << *(inventory[index]) << "\n" ;
  809.    }
  810.    cout << '\n';
  811.    cout << decanter;
  812.    cout << '\n';
  813.    player1 += decanter;
  814.    for (index=0;index < sizeof(inventory)/sizeof(GameObject*);index++) {
  815.        cout << *(inventory[index]) << "\n" ;
  816.    }
  817.    cout << '\n';
  818.    cout << decanter;
  819.    cout << '\n';
  820.    cout << player1;
  821.    cout << '\n';
  822.    cout << room;
  823.    cout << '\n';
  824.    cout << helicopter;
  825.    cout << HeliPanel;
  826. }
  827.  
  828.  
  829. SHAR_EOF
  830. fi # end of overwriting check
  831. #    End of shell archive
  832. exit 0
  833.